/**************************
* @Summary
* @Author 20009200303 赵传博
* @Date 2022/4/26
*****************************/

#include "Tnode.h"

#include <utility>

Tnode::Tnode() {
    word = "";
    count = 0;
    left = nullptr;
    right = nullptr;
}

Tnode::Tnode(string word) {
    this->word = std::move(word);
    count = 1;
    left = nullptr;
    right = nullptr;
}

const string &Tnode::getWord() const {
    return word;
}

int Tnode::getCount() const {
    return count;
}

Tnode *Tnode::getLeft() const {
    return left;
}

Tnode *Tnode::getRight() const {
    return right;
}



Tnode::~Tnode() = default;

void Tnode::addCount(int count) {
    this->count += count;
}

void Tnode::setLeft(Tnode *left) {
    Tnode::left = left;
}

void Tnode::setRight(Tnode *right) {
    Tnode::right = right;
}
